//-----------------------------------------------------------------------
// <copyright file="AddressChangingEventArgs.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Microsoft.Live.Messenger
{
    using System;

    /// <summary>
    ///     Represents the method that will handle the <see cref="Contact.CurrentAddressChanging"/> event of a <see cref="Contact"/>.
    /// </summary>
    /// <param name="sender">The contact object.</param>
    /// <param name="e">The event arguments.</param>
    public delegate void AddressChangingEventHandler(
        object sender,
        AddressChangingEventArgs e);

    /// <summary>
    /// Provides data for the <see cref="AddressChangingEventHandler"/> event.
    /// </summary>
    public class AddressChangingEventArgs : EventArgs
    {
        private readonly IMAddress oldAddress;
        private readonly IMAddress newAddress;

        /// <summary>
        ///     Initializes a new <see cref="AddressChangingEventArgs"/> instance.
        /// </summary>
        /// <param name="oldAddress">The old address.</param>
        /// <param name="newAddress">The new address.</param>
        public AddressChangingEventArgs(
            IMAddress oldAddress,
            IMAddress newAddress)
        {
            this.oldAddress = oldAddress;
            this.newAddress = newAddress;
        }

        /// <summary>
        ///     The old address
        /// </summary>
        public IMAddress OldAddress
        {
            get { return this.oldAddress; }
        }

        /// <summary>
        ///     The new address
        /// </summary>
        public IMAddress NewAddress
        {
            get { return this.newAddress; }
        }
    }
}